<!-- 病例详情记录 -->
<template>
  <div>
    <el-row>
      <div class="mb8" style="width: 100%">
        <el-button @click="goBack" icon="arrow-left" type="primary">
          返回
        </el-button>
      </div>
    </el-row>
    <el-descriptions title="病例详情" :column="6" border>
      <el-descriptions-item v-if="patientCaseData.caseId" label="病例id:">{{ patientCaseData.caseId }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.patientUid" label="患者id:">{{ patientCaseData.patientUid }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.patientType" label="病人居住类型:">{{ patientCaseData.patientType }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.educationLevel" label="学历:">{{ patientCaseData.educationLevel }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.insuranceType" label="保险类型:">{{ patientCaseData.insuranceType }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.occupation" label="患者职业:">{{ patientCaseData.occupation }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.onsetDatetime" label="发病具体时间:">{{ patientCaseData.onsetDatetime }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.patientSource" label="患者类型:">{{ patientCaseData.patientSource }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.temperature" label="体温值(℃):">{{ patientCaseData.temperature }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.pulseRate" label="心率(次/min):">{{ patientCaseData.pulseRate }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.systolicBp" label="高压(mmHg):">{{ patientCaseData.systolicBp }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.diastolicBp" label="低压(mmHg):">{{ patientCaseData.diastolicBp }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.weight" label="体重(kg):">{{ patientCaseData.weight }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.illnessSeverity" label="患者病情代码:">{{ patientCaseData.illnessSeverity }}</el-descriptions-item>
    </el-descriptions>
    <el-descriptions border>
      <el-descriptions-item v-if="patientCaseData.addressProvince" label="所在省份:">{{ patientCaseData.addressProvince }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.addressCity" label="所在地级市:">{{ patientCaseData.addressCity }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.addressCounty" label="所在县区:">{{ patientCaseData.addressCounty }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.addressTown" label="所在乡镇/街道办:">{{ patientCaseData.addressTown }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.addressVillage" label="所在村庄/街道:">{{ patientCaseData.addressVillage }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.addressDetail" label="详细住址:">{{ patientCaseData.addressDetail }}</el-descriptions-item>
    </el-descriptions>

    <el-descriptions :column="1" border>
      <el-descriptions-item v-if="patientCaseData.chiefComplaint" label="主诉:">{{ patientCaseData.chiefComplaint }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.presentIllness" label="现病史:">{{ patientCaseData.presentIllness }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.pastIllness" label="既往病史:">{{ patientCaseData.pastIllness }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.allergySymptom" label="过敏症状:">{{ patientCaseData.allergySymptom }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.allergenName" label="过敏源:">{{ patientCaseData.allergenName }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.severityLevel" label="严重程度:">{{ patientCaseData.severityLevel }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.physicalExam" label="体格检查:">{{ patientCaseData.physicalExam }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.auxiliaryExam" label="辅助检查:">{{ patientCaseData.auxiliaryExam }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.diagnosisName" label="诊断名称:">{{ patientCaseData.diagnosisName }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.otherTreatment" label="其他医学处置:">{{ patientCaseData.otherTreatment }}</el-descriptions-item>
      <el-descriptions-item v-if="patientCaseData.doctorAdvice" label="医嘱内容:">{{ patientCaseData.doctorAdvice }}</el-descriptions-item>
    </el-descriptions>
  </div>
</template>

<script lang="ts" setup>
import { computed } from 'vue';

const props = defineProps<{
  patientCaseObj: any
}>()

const emit = defineEmits<{
  (e: 'changeShowPatientCaseDetail', tmp: boolean): void
}>()

// 使用计算属性得到patientCaseData

const patientCaseData = computed(() => {
  return props.patientCaseObj
})

// 反馈病例详情列表
const goBack = () => {
  emit('changeShowPatientCaseDetail', false)
}
</script>
